package com.feicheng.controller.qw;

import com.alibaba.fastjson.JSONObject;
import com.feicheng.common.message.MqttInfo;
import com.feicheng.common.result.ResultInfo;
import com.feicheng.common.task.Cache;
import com.feicheng.common.task.MjmdTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/qw")
@Slf4j
public class QwController {

    public static class CMD {
        public static final String  CMD_ID = "CmdID";
        public static final String  CMD_CODE = "CmdCode";
        public static final String  CMD_STATUS = "CmdStatus";
        public static final String  CMD_PARAMS = "CmdParams";
        public static final String  CMD_STATUS_DESC = "CmdStatusDesc";
        public static final String  VIEW_ID = "ViewId";
        public static final String  UID = "UID";
        public static final String  UKEY = "UKey";
    }

    public static class QCODEACCESSVAL {
        public static final String CODEVAL = "CodeVal";
        public static final String SN = "SN";
        public static final String UID = "UID";
        public static final String STATUS = "Status";
        public static final String VIEWID = "ViewId";
        public static final String STORE_ID = "StoreId";
        public static final String CLIENT_ID = "ClientId";
        public static final String UKEY = "UKey";

    }


    @Autowired
    MjmdTask task;

    @Autowired
    Cache cache;

    @Autowired
    MqttInfo mqttInfo;


    @GetMapping("/initdailytask")
    public ResultInfo runDailyTask() {
        task.runDzDailyTask();
        return ResultInfo.success();
    }

    @GetMapping("/initcache")
    public ResultInfo initcache() {
        cache.init();
        return ResultInfo.success();
    }

}
